package cn.pigeon.health.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/person")
public class PersonController {
    @RequestMapping("/add")
    @PreAuthorize("hasAuthority('add')")
    public String add(){
        return "add Method";
    }

    @RequestMapping("/list")
    @PreAuthorize("hasAuthority('list')")
    public String list(){
        return "list Method";
    }

    @RequestMapping("/delete")
    @PreAuthorize("hasRole('ROLE_ADMIN')")
    public String delete(){
        return "delete Method";
    }
}
